package gui.navigation;

import gui.MyFrame;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JPanel;

public class OthersGui extends JPanel {

	public OthersGui(final MyFrame myFrame) {
		this.setLayout(new GridLayout(5, 1));
		this.setPreferredSize(new Dimension(200, 300));
		JButton pii = new JButton("Nth digit of PI after comma");
		pii.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.PI);
			}
		});
		this.add(pii);
		JButton fibbo = new JButton("Fibonacci sequence");
		fibbo.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.FIBBO);
			}
		});
		this.add(fibbo);
		
		JButton primenr = new JButton("Prime numbers");
		primenr.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.PRIME);
			}
		});
		this.add(primenr);
		
		JButton converter = new JButton("Convert units");
		converter.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.CONVERT);
			}
		});
		this.add(converter);
		JButton back = new JButton("Back");
		back.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setNavigationPanel(MyFrame.MAIN);
			}
		});
		this.add(back);
	}
}
